package com.warm.pump.module.monitor.service.impl;

import com.warm.pump.frame.gen.bean.PageBean;
import com.warm.pump.module.monitor.bean.po.gen.LogMailHis;
import com.warm.pump.module.monitor.dao.gen.LogMailHisDao;
import com.warm.pump.module.monitor.service.ILogMailHisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


@Service("LogMailHisService")
public class LogMailHisServiceImpl implements ILogMailHisService {
    @Autowired
    private LogMailHisDao logMailHisDao;

    @Override
    public LogMailHis queryObject(Long oid) {
        return logMailHisDao.selectByPrimaryKey(oid);
    }

    @Override
    public List<LogMailHis> queryList(Map<String, Object> map) {
        return logMailHisDao.getListByMap(map);
    }

    @Override
    public PageBean getPageBeanByMap(Map map, int pageNo, int pageSize) {
        return logMailHisDao.getPageBeanByMap(map, pageNo, pageSize);
    }


    @Override
    public int queryTotal(Map<String, Object> map) {
        return logMailHisDao.countTotalByMap(map);
    }

    @Override
    public void save(LogMailHis logMailHis) {
        logMailHisDao.insertSelective(logMailHis);
    }

    @Override
    public void update(LogMailHis logMailHis) {
        logMailHisDao.updateByPrimaryKeySelective(logMailHis);
    }

    @Override
    public void delete(Long oid) {
        logMailHisDao.deleteByPrimaryKey(oid);
    }

    @Override
    public void delete(Map<String, Object> map) {
        logMailHisDao.deleteByMap(map);
    }

    @Override
    public void deleteBatch(Long[] oids) {
        Map<String, Object> map = new HashMap<>();
        map.put("oid_in", oids);
        logMailHisDao.deleteByMap(map);
    }

}
